//整个应用的根组件
<template>
  <div id="app">
    <transition name="fade">
      <keep-alive>
        <router-view></router-view>
      </keep-alive>
    </transition>
  </div>
</template>

<script>
  export default {
    name: 'app',
    data() {
      return {
        isLogin: false,
        userInfo: {}
      }
    },
    created(){
      this.getUserInfo();
    },
    mounted() {
      // Waves.displayEffect();
    },
    methods: {
      //请求用户的一些信息
      getUserInfo() {
        //发送http请求获取，这里写死作演示
        /*this.userInfo = {
          username: '领衔主演-云',
          psw: 20,
          imgurl: '/static/images/profile.png'
        };*/

        /*//实例开发中这里会向服务端请求数据
        this.ajax.get('/api/users')
          .then((data) => {
//          console.log(data.data[0]);
          this.$store.commit('updateUserInfo', data.data[0]);
        }, (response) => {
          //Error
        });*/

        //提交mutation到Store

      }
    }
  }
</script>

<style lang="less">
  @import './assets/css/reset.less';
  html, body,#app{
    height: 100%;
  }

  /* transition animate */
  .fade-enter-active, .fade-leave-active {
    transition: opacity .5s
  }

  .fade-enter, .fade-leave-active {
    opacity: 0
  }

  .slide-enter-active {
    transition: all .2s ease-in-out;
  }

  .slide-leave-active {
    /* transition: all .3s cubic-bezier(1.0, 0.5, 0.8, 1.0); */
  }

</style>
